package com.service.impl;

import com.mapper.OrderDetailMapper;
import com.pojo.Orderdetail;
import com.service.OrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class OrderDetailServiceImpl implements OrderDetailService {
    @Autowired
    private OrderDetailMapper orderDetailMapper;

    public List<Orderdetail> showList(String uname,String cName) {
        return orderDetailMapper.showList(uname,cName);
    }

    public boolean delOrderDetailByOid(int oid) {
        int i = orderDetailMapper.delOrderDetail(oid);
        if (i>0){
            return true;
        }
        return false;
    }

    public Orderdetail findByOid(int id) {
        return orderDetailMapper.findByOid(id);
    }

    public List<Orderdetail> findByuNameAndcName(String uname, String cName, String orderStatus) {
        return orderDetailMapper.findByuNameAndcName(uname,cName,orderStatus);
    }
}
